{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

					<li><a href="{$add_url}"><i class="glyphicon glyphicon-plus"></i> 添加管理员</a></li>
					<li class="active"><a href="javascript:void(0);"><i class="glyphicon glyphicon-th-list"></i> 管理员列表</a></li>
					<!--<li><a href="/admin/index/edit"><i class="glyphicon glyphicon-edit"></i> 编辑管理员</a></li>-->

				</ul>
				<div class="inner-container">
					<form class="form-inline search-form" role="form" id="J_List_Form">
						<input type="hidden" name="pagesize" value="{$pagesize}" >
						<div class="form-group">
							<select name="select_mix_option1" class="form-control input-sm" data-value="{$select_mix_option1}">
								<option value="username">登录账号</option>
								<option value="jobno">工号</option>
								<option value="name">姓名</option>
								<option value="mobile">联系方式</option>
								<option value="email">Email</option>

							</select>
						</div>
						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">

								<input type="text" class="form-control input-sm" maxlength="{maxlength}" placeholder="关键词" name="select_mix_option_value1" value="{$select_mix_option_value1}">
							</div>
						</div>

						
						<!-- searchselectscript -->
						<!-- 
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									角色ID
								</div>
								<select id="s_role_id" class="form-control input-sm select2" name="s_role_id">
									<option value="">-- 请选择 --</option>
									{loop $role_idoptions $v}
									<option {if $item[role_id] == $v[id]}selected{/if} value="{$v[id]}">{$v[id]}</option>
									{/loop}
									
						
								</select>
							</div>
						
							<script type="text/javascript">
								var s_role_id = '{$s_role_id}';
								var sdom = document.getElementById('s_role_id');
								for(i = 0; i < sdom.options.length;i ++){
									if(s_role_id == sdom.options[i].value)
									{
										sdom.options[i].setAttribute('selected',true);
									}
								}
							</script>
						</div>
						
						-->

						<div class="form-group">
							<select name="select_mix_option2"  class="form-control input-sm"  data-value="{$select_mix_option2}">
								<option value="add_time">创建时间</option>
								<option value="last_login_time">最后登陆时间</option>
							</select>
						</div>
						<!-- searchdatetime -->
						<div class="form-group">
							<div class="input-group">

								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
									   name="start_time" value="{$start_time}"
									   placeholder="开始时间" />

								<div class="input-group-addon">
									-
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
									   name="end_time" value="{$end_time}"
									   placeholder="结束时间" />
							</div>
						</div>
						
						<!-- searchselectscript -->
						<div class="form-group">
							<div class="input-group">
								<div class="input-group-addon">
									账户状态
								</div>
								<select id="s_status" class="form-control input-sm" name="s_status">
									<option value="">-- 请选择 --</option>
									<!--tmpl-options-->
						
									<!-- option -->
									<option {if $s_status==1}selected="selected"{/if} value="1">启用</option>
									
									<!-- option -->
									<option {if $s_status===0}selected="selected"{/if} value="0">禁用</option>
									
						
								</select>
							</div>
						</div>

						<input type="hidden" name="order" value="{$order}">
						<button type="submit" class="btn btn-sm btn-success">搜索</button>
						{run exportBtn()}
						<!-- search form end -->
					<!--</form>
					<form id="J_List_Form">-->
						<div class="table-responsive">
							<table id="J_ListTable" class="table  table-hover  table-striped">
								<!--tmpl-listtable-->

								<!-- listblock -->
								<thead>
									<tr>
										<th width="20"><input type="checkbox" class="icheck check-all" /></th>
										<!--tmpl-fieldheaders-->
								
										<th>用户名<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="username ASC"}username DESC{else}username ASC{/if}' class='fa ofield {if $order=="username ASC"}fa-chevron-up{elseif $order=="username DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>手机号码<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="mobile ASC"}mobile DESC{else}mobile ASC{/if}' class='fa ofield {if $order=="mobile ASC"}fa-chevron-up{elseif $order=="mobile DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>工号<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="jobno ASC"}jobno DESC{else}jobno ASC{/if}' class='fa ofield {if $order=="jobno ASC"}fa-chevron-up{elseif $order=="jobno DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>电子邮箱<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="email ASC"}email DESC{else}email ASC{/if}' class='fa ofield {if $order=="email ASC"}fa-chevron-up{elseif $order=="email DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>姓名<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="name ASC"}name DESC{else}name ASC{/if}' class='fa ofield {if $order=="name ASC"}fa-chevron-up{elseif $order=="name DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>角色<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="role_id ASC"}role_id DESC{else}role_id ASC{/if}' class='fa ofield {if $order=="role_id ASC"}fa-chevron-up{elseif $order=="role_id DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>最后登陆时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="last_login_time ASC"}last_login_time DESC{else}last_login_time ASC{/if}' class='fa ofield {if $order=="last_login_time ASC"}fa-chevron-up{elseif $order=="last_login_time DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>最后登陆ip<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="last_login_ip ASC"}last_login_ip DESC{else}last_login_ip ASC{/if}' class='fa ofield {if $order=="last_login_ip ASC"}fa-chevron-up{elseif $order=="last_login_ip DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>账户状态<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="status ASC"}status DESC{else}status ASC{/if}' class='fa ofield {if $order=="status ASC"}fa-chevron-up{elseif $order=="status DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>添加人<!--tmpl-orderth-->
										</th>
										<th>添加时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="addtime ASC"}addtime DESC{else}addtime ASC{/if}' class='fa ofield {if $order=="addtime ASC"}fa-chevron-up{elseif $order=="addtime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
										<th>更新时间<!--tmpl-orderth-->
										
										&nbsp;<i data-val='{if $order=="updatetime ASC"}updatetime DESC{else}updatetime ASC{/if}' class='fa ofield {if $order=="updatetime ASC"}fa-chevron-up{elseif $order=="updatetime DESC"}fa-chevron-down{else}fa-minus{/if}' style='color:#eee;' href='javascript:;'></i>
										</th>
								
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td style="text-align:center;" colspan="12" class="empty-table-td">{$emptyRecord}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td>{if $myInfo['id']!=$value[id]}<input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/>{/if}</td>
									<!--tmpl-fieldlist-->
								
									<td>{$value[username]}</td>
									<td>{$value[mobile]}</td>
									<td>{$value[jobno]}</td>
									<td>{$value[email]}</td>
									<td>{$value[name]}</td>
									<td>{if $value[role_name]}{$value[role_name]}{else}超级管理员{/if}</td>
									<td>{$value[last_login_time]}</td>
									<td>{expr long2ip($value[last_login_ip])}</td>
									<td><input data-id="{$value[id]}" {if $myInfo['id'] == $value[id]}disabled="disabled"{/if} type='checkbox' data-on-text='启用' data-off-text='禁用' class='bswitch js-status' data-size='mini' {if $value[status]}checked{/if} ></td>
									<td>{$value[manager_name]}</td>
									<td>{$value[addtime]}</td>
									<td>{$value[updatetime]}</td>
									<td>
										<!--tmpl-listbtn-->
										<!-- listbtnedit -->
										{if $myInfo['id'] != $value[id]}
										{if in_array('admin/manager/edit',$priv) || empty($priv)}
										<a href="{$edit_url}?id={$value[id]}" class="btn btn-primary btn-xs">
											<i class="glyphicon glyphicon-edit"></i> 编辑</a>
										{/if}
										
										<!-- listbtndelete -->
										{if in_array('admin/manager/delete',$priv) || empty($priv)}
										<a href="{$delete_url}?id={$value[id]}" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</a>
										{/if}
										{else}
										{if in_array('admin/manager/edit',$priv) || empty($priv)}
										<button disabled="disabled" class="btn btn-primary btn-xs">
											<i class="glyphicon glyphicon-edit"></i> 编辑</button>
										{/if}
										
										<!-- listbtndelete -->
										{if in_array('admin/manager/delete',$priv) || empty($priv)}
										<button disabled="disabled" class="btn btn-danger btn-xs item-remove">
											<i class="glyphicon glyphicon-trash"></i> 删除</button>
										{/if}

										{/if}
									</td>
								</tr>
								{/loop}
							</table>

						</div>
						
					</form>
					<div class="text-right" style="float: right">
						{$pagemenu}
					</div>
					<div class="button-group pagination" style="float: left">
						<select name="action-bacth-select"  disabled class="form-control input-sm" >
							<option value="" checked="true">-批量操作-</option>

							<option value="on" >启用</option>
							<option value="off">禁用</option>

						</select>
					</div>
				</div>
			</div>
		</section>
	</div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->

<!-- assocalert -->
<script id="admin_role-assoc-box" type="text/html">
<div class="assoc-alertbox">
	<div class="searchbar">
		<form class="assoc-foreign-form form-inline">
			<!--tmpl-search-->

			<!-- searchinput -->
			<div class="form-group">
				<div class="input-group">
					<div class="input-group-addon">
						
					</div>
					<input type="text" class="form-control input-sm" maxlength="50" placeholder="" name="s_name" value="{$s_name}">
				</div>
			</div>
			
			
			
			
			
			
			
			

			<input type="hidden" name="order" value="{$order}">
			<input type="btn" class="btn btn-sm btn-success assoc-search-btn" value="搜索"/>
		</form>
	</div>
	<div class="content">
	
	</div>
	<div class="paginate">

	</div>
</div>
</script>

<!-- assoclist -->
<script id="admin_role-assoc-tablelist" type="text/html">
<table class="table  table-condense">
	<tr>
		<th><input type="checkbox" id="assoc-selectall" ></th>
		<!--tmpl-th-->

		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th></th>
		<th>AppId</th>

	</tr>
	{[loop items item]}
	<tr>
		<td><input type="checkbox" name="assoc[]" value="{[item.id]}"></td>
		<!--tmpl-td-->

		<td>{[item.name]}</td>
		<td>{[item.role_key]}</td>
		<td>{[item.remark]}</td>
		<td>{[item.addtime]}</td>
		<td>{[item.edittime]}</td>
		<td>{[item.admin_manager_id]}</td>
		<td>{[item.del_status]}</td>
		<td>{[item.app_id]}</td>


	</tr>
	{[/loop]}
</table>
</script>




<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/admin_managerindex",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->

		parameter.admin_role_assoc_url="{$admin_role_assoc_url}";

		parameter.detailUrl="{$detail_url}";
		parameter.deleteUrl="{$delete_url}";
		parameter.editUrl="{$do_edit_url}";
		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[loop pages page]}

		<li {[if curr == page]}class="active"{[/if]}><a class="assoc-page" data-page="{[page]}"  href="javascript:void(0)">{[page]}</a></li> 

		{[/loop]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>
</body>
</html>
